#!/usr/bin/python

import pygtk
import gtk

class POP_MSG():
    def __destroy(self, widget, data=None):
        gtk.main_quit()

    def __comfirmClicked(self, widget, data=None):
        gtk.mainquit()

    def __createWindow(self):
        self.__table = gtk.Table( 4, 3, True )
        self.__window.add( self.__table )
        self.__msgRegion = gtk.Button()
        self.__table.attach( self.__msgRegion, 0, 3, 0, 3 )
        self.__comfirm = gtk.Button()
        self.__table.attach( self.__comfirm, 1, 2, 3, 4 )
        self.__comfirm.set_label( 'comfirm' )
        self.__comfirm.connect( 'clicked', self.__comfirmClicked, 1 )
        
        if False==isinstance(self.__msg, str):
            msg = ''
            for item in self.__msg:
                msg += item
            #print 'To show : ', msg
            self.__msgRegion.set_label( msg )
        else:
            self.__msgRegion.set_label( self.__msg )

    def __init__(self, message):
        self.__window = gtk.Window( gtk.WINDOW_TOPLEVEL )
        self.__window.connect( 'destroy', self.__destroy )
        self.__window.set_border_width( 10 )
        self.__window.set_default_size( 300, 300 )
        self.__msg = message
        self.__createWindow()
        self.__window.show_all()
        gtk.main()
